package com.arceus.leetcode;

import java.util.HashSet;
import java.util.Set;

/**
 * @author : iron
 * @version : 1.0.0
 * @date : 5:59 PM 2019/3/1
 */

public class T804 {

    public static int uniqueMorseRepresentations(String[] words) {
        String pass[] = new String[]{".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."};
        Set<String> set = new HashSet<>();
        for (String s : words) {
            char[] word = s.toCharArray();
            String key = "";
            for (char c : word) {
                key += pass[c - 'a'];
            }
            set.add(key);
        }
        return set.size();
    }

    public static void main(String[] args) {
        String pass[] = new String[]{"wa", "asdas"};
        System.out.println(uniqueMorseRepresentations(pass));
    }
}
